import request from '@/utils/request'

export const getUserInfoListApi = (currentPage, PageSize, userName) => {
  return request({
    url: `/admin/acl/user/${currentPage}/${PageSize}?username=${userName}`,
    method: 'get'
  })
}

export const SaveUserInfoApi = (obj) => {
  return request({
    url: `/admin/acl/user/save`,
    method: 'post',
    data: obj
  })
}

export const DelUserInfoApi = (id) => {
  return request({
    url: `admin/acl/user/remove/${id}`,
    method: 'delete'
  })
}

export const getToAssignApi = (id) => {
  return request({
    url: `/admin/acl/user/toAssign/${id}`,
    method: 'get'
  })
}

export const SaveUserAssignApi = (userId, roleId) => {
  return request({
    url: `/admin/acl/user/doAssign?userId=${userId}&roleId=${roleId}`,
    method: 'post'
  })
}

export const updateUserInfoApi = (obj) => {
  return request({
    url: '/admin/acl/user/update',
    method: 'put',
    data: obj
  })
}
